<template>
	<div id="home">
		<topbar></topbar>
		<banner :shujv_b="banner"></banner>
		<goodsnav :shujv="goods"></goodsnav>
		<gujiaping v-if="isXianshi"></gujiaping>
		<slidflash :shujv_shangpin="shangpin"></slidflash>
		<!-- 分割线 -->
		<van-divider
		  :style="{ color: '#000', borderColor: '#d8d8d8', padding: '0 10px' }"
		>
		  <span style="font-size: 16px; color: #000000; padding: 10px 20px; background-color: #f5f5f5;">猜你喜欢</span>
		</van-divider>
		<!-- 商品主内容 -->
		<goods :shujv_goods="bottomGoods"></goods>
		<!-- 回到顶部 -->
		<vueToTop type=1 bottom=60 right=16 size=30></vueToTop>
	</div>
</template>

<script>
	import {home} from '@/api'
	import topbar from './topbar'
	import gujiaping from './gujiaping'
	import banner from './banner'
	import goodsnav from './goodsnav'
	import slidflash from './slidflash'
	import goods from './goods'
	export default {
		name: 'home',
		data(){
			return{
				isXianshi : true,
				goods : [],
				banner : [],
				shangpin : [],
				bottomGoods : []
			}
		},
		components:{
			topbar,
			banner,
			goodsnav,
			gujiaping,
			slidflash,
			goods,
		},
		methods:{
			async home(){
				let res = await home()
				this.goods = res.data.data.list[2].icon_list
				this.banner = res.data.data.list[0].icon_list
				this.shangpin = res.data.data.list[3].product_list
				this.bottomGoods = res.data.data.list[12].product_list
				this.isXianshi = false
			},
		},
		created(){
			this.home()
			console.log(this.$route.matched)
		},
	}
</script>

<style scoped lang="less">
	
</style>
